function checkBase(){
    var name = document.getElementById("uname").value;
    var phone = document.getElementById("uphone").value;

    // 去除name空格
    name = name.replace(/\s+/g, "");
    if (name == ""){
        alert("用户昵称不能为空");
        return false;
    }

    if (phone == ""){
        alert("手机号不能为空");
        return false;
    }

    if(phone.length != 11){
        alert("手机号长度错误");
        return false;
    }

    //正则验证手机号
    var reg = /^1[3456789]\d{9}$/;
    if (!reg.test(phone)){
        alert("请输入正确的手机号");
        return false;
    }
}

function checkPwd(){
    var oldpass = document.getElementById("old_pwd").value;
    var newpass = document.getElementById("new_pwd").value;
    var newpass2 = document.getElementById("rnew_pwd").value;

    // 除去空格
    oldpass = oldpass.replace(/\s+/g, "");
    newpass = newpass.replace(/\s+/g, "");
    newpass2 = newpass2.replace(/\s+/g, "");

    if (oldpass == ""){
        alert("旧密码不能为空");
        return false;
    }

    if (newpass == ""){
        alert("新密码不能为空");
        return false;
    }

    if( newpass.length < 6){
        alert("密码长度不能小于6位");
        return false;
    }

    if (newpass != newpass2){
        alert("两次密码不一致");
        return false;
    }
}